/*
 * @Description:
 * @Version: 2.0
 * @Autor: wsh
 * @Date: 2023-06-20 16:06:20
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2024-04-23 17:30:13
 */

let classifyList = [
	{label:"大众用户",value:"1",type:"primary"},
	{label:"平台管理员",value:"2",type:"primary"},
	{label:"政务用户",value:"3",type:"primary"},
	{label:"养老服务组织用户",value:"4",type:"primary"},
	{label:"服务商用户",value:"5",type:"primary"},
]
// 列表
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
        { label: '用户ip', prop: 'remoteAddr',width: 150 },
		{ label: '身份证号', prop: 'idCard',width: 200,plusXing: '2,2', },
		{ label: '用户名称', prop: 'realName',width: 200 },
		{ label: '用户类型', prop: 'classifyId',custome:"tag",dicData:classifyList,width: 150},
		{
			label: '用户账户',
			prop: 'createBy',
			width: 200,
            plusXing: '2,2'
		},
		{
			label: '操作时间',
			width: 200,
			prop: 'createTime',
		},
		{
			label: '用户操作内容',
			prop: 'title',
		},
		{
			label: '操作',
			prop: 'menu',
			width: 100,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'sys_log_page'
}

export const baseConfig = {
	pageName: '数据留痕',
	// 数据字典
	dictcodes: [],
	rowKey: 'id',
	tipLabel: 'name',
	addLabel: '新增',
	api: {
		...api,
	},
	auth: {
		...api,
	},
	paramsObj:{
		
	},
	// 当前行操作按钮
	menuBtn: [
		{
			label: '详情',
			type: 'primary',
			operate: 'detail',
			auth: api.index,
			text: true,
			show: true,
		}
	],

	dialogConfig: {
		width: '40%',
	},
	detailConfig:{
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{ label: '用户ip', prop: 'remoteAddr',span:12 },
			{ label: '身份证号', prop: 'idCard',span:12  },
			{ label: '用户名称', prop: 'realName',span:12 },
			{ label: '用户类型', prop: 'classifyId',type:"tag",dicData:classifyList,span:12},
			{
				label: '用户账户',
				prop: 'createBy',
				span:12
			},
			{
				label: '操作时间',
				prop: 'createTime',
				span:12
			},
			{
				label: '用户操作内容',
				prop: 'title',
				span:12
			}
		]
	},
	// 搜索
	searchConfig: {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{ label: '用户名称', prop: 'realName', type: 'input', span: 8 },
			{ 
				label: '用户类型', 
				prop: 'classifyId',
				type:"select",
				dicData:classifyList,
				span:8},
			{
				label: '用户账号',
				prop: 'createBy',
				span: 8,
			},
			{
				label: '操作内容',
				prop: 'title',
				placeholder:'例如：删除账户或人脸识别',
				span: 8,
			},
			{
				label: '时间段',
				type: 'datetimerange',
				"start-placeholder":'开始时间',
				"end-placeholder":'结束时间',
				format: 'YYYY年MM月DD HH:mm:ss',
				valueFormat: 'YYYY-MM-DD HH:mm:ss',
				prop: 'createTime',
				span: 8,
			},
			{ label: '身份证号', prop: 'idCard',span:8  },
		],
	},
	// 列表
	tableConfig,
    saveFormate: async (form) => {
		return new Promise((resolve, reject) => {
			resolve(form)
		})
	},
	onLoadFormate: async (arr) => {
		let tableData = arr.map((item) => {
			return item
		})
		return Promise.resolve(tableData)
	},
	beforeOnLoadFormate(form) {
		return new Promise((resolve, reject) => {
			resolve(form)
		})
	},
}
